package com.example.demo.modules.es.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@Document(indexName = "users")
public class User {

    @Id
    @ApiModelProperty(value = "主键id")
    private String id;

    @Field(type = FieldType.Text)
    @ApiModelProperty(value = "用户名")
    private String name;

    @Field(type = FieldType.Integer)
    @ApiModelProperty(value = "性别", notes = "0_男 1_女")
    private Integer sex;

    @Field(type = FieldType.Integer)
    @ApiModelProperty(value = "年龄")
    private Integer age;

    @Field(type = FieldType.Text)
    @ApiModelProperty(value = "地址")
    private String address;

}
